/**
 * created by dqn 2018/3/8 15:47
 */

package main.controller.pages;

import main.entity.WebUser;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpSession;

@Controller
public class AdminController {
    @RequestMapping(value = "/admin/page", method = RequestMethod.GET)
    public String adminPage(HttpSession httpSession) {
        WebUser webUser = (WebUser) httpSession.getAttribute("user");
        if (webUser == null || !webUser.getPermission().equals(WebUser.ADMINISTRATOR)) {
            return "redirect:/";
        } else {

        }
        return "admin";
    }
}
